package com.bplow.deep.base.aspectj;

import java.util.concurrent.TimeUnit;

import org.springframework.stereotype.Service;

import com.bplow.deep.base.concurrent.synclock.EnableSyncLock;
import com.bplow.deep.base.concurrent.synclock.SyncLock;

@Service
@EnableSyncLock
public class BeanValidatorTest {

	@ValidatorParam
	@SyncLock(synKey="")
	public String execute(BeanTest order) {
		System.out.println("執行");
		return "12345";
	}
	
	@SyncLock(synKey="987654321")
	public String print(BeanTest order) {
		System.out.println("开始受理"+order.getOrderId());
		try {
			TimeUnit.MILLISECONDS.sleep(10000l);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("受理完成"+order.getOrderId());
		return order.getOrderId();
	}

}
